﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="connDbBean" scope="page" class="com.util.db"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="js/popup.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<TITLE>讨论区</TITLE>
	    
 	<script type="text/javascript" src="ny/js/jquery.min.js"></script>
<script type="text/javascript" src="ny/js/bootstrap.min.js"></script>
<script src="ny/js/jconfirm/jquery-confirm.min.js"></script>
<link href="ny/css/bootstrap.min.css" rel="stylesheet">
<link href="ny/css/materialdesignicons.min.css" rel="stylesheet">
<link href="ny/css/style.min.css" rel="stylesheet">
<link rel="stylesheet" href="ny/js/jconfirm/jquery-confirm.min.css"> 
	</head>
<%
  String id="";
  id=request.getParameter("id");
   %>

<script language="javascript">

function gows()
{
	document.location.href="liuyanxinxi_add.jsp?id=&lt;%=id%>";
}
function hsgxia2shxurxu(nstr,nwbk)
{
	if (eval("form1."+nwbk).value.indexOf(nstr)>=0)
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value.replace(nstr+"；", "");
	}
	else
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value+nstr+"；";
	}
}
</script>
<body>

<div >
              <div class="card-header"><h4>讨论区</h4></div>
              <div class="card-body">
			  
		 
								
								   <form action="bbslist.jsp" name="myform" method="post" class="form-inline" >
                  <div class="form-group">
                      标题：<input name="biaoti" type="text" id="biaoti" class='form-control' style="width:300px;"  />  
                  </div>
                  <div class="form-group">
                    <button  class="btn btn-primary" type="submit">搜索</button> <input type=button name=Submit52 value=发起讨论 class="btn btn-primary" onClick="javascript:location.href='tieziadd.jsp';" />
                  </div>
                </form>
								
								
			   <table class="table table-hover">
  <thead>
  <tr>
                                  <th width="712">标题</th>
                                 <th width="185" align="center">发起人</th>
                                 <th width="221" align="center">发布时间</th>
                                 <th width="222" align="center">已有回复</th>
                                </tr>
								</thead>
   <tbody>
                                 <% 
   try {
    String sqlbbs =  "select * from tiezi where  fid='0'  ";
	 
	if(request.getParameter("biaoti")=="" ||request.getParameter("biaoti")==null ){}else{String nbiaoti=new String(request.getParameter("biaoti").getBytes("8859_1"));if(nbiaoti.contains("?")){nbiaoti=request.getParameter("biaoti");}sqlbbs=sqlbbs+" and biaoti like '%"+nbiaoti+"%'";}
	
	sqlbbs+=" order by id desc";
	int bbsi=0;
     
	 ResultSet RS_resultbbs=connDbBean.executeQuery(sqlbbs);
	 if(RS_resultbbs != null) {
		while(RS_resultbbs.next()){
			bbsi++;
     %>
                                <tr>
                                  <td  ><a href="tiezidetail.jsp?id=<%=RS_resultbbs.getString("id") %>"><%
								  if(RS_resultbbs.getString("issh").equals("是"))
								  {
								  %>
								  <img src="bbs/zhiding.png" width="15" height="15" style="padding-top:5px;">
								  <%
								  }
								  %><%=RS_resultbbs.getString("biaoti") %> </a></td>
                                    <td align="left"><span class="STYLE1"></span><%=RS_resultbbs.getString("faburen") %></td>
                                    <td   align="left"><span class="STYLE1"></span><%=RS_resultbbs.getString("addtime") %></td>
                                    <td   align="left"><span class="STYLE1"></span><%=connDbBean.gettzs((String)RS_resultbbs.getString("id")) %></td>                               </tr>
	<%
		}
	 } else {
		%>
		<tr><td colspan="4" align="center">暂无讨论内容</td></tr>
		<%
	 }
   } catch(Exception e) {
		System.err.println("查询讨论区出错: " + e.getMessage());
		e.printStackTrace();
		%>
		<tr><td colspan="4" align="center">系统错误，请稍后重试</td></tr>
		<%
   }
   %>
                        </tbody>
</table>
              </div>
            </div>
<p>&nbsp;</p>
</body>
</html>




<script language=javascript >  
 
 function checkform(){  
 
	 
	


return true;   
}   
popheight=450;
</script>  